{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Learning from continuous data is almost identical to learning from discrete data. Instead of generating local scores using BDeu scoring, BGe scoring is used. BGe scoring implicitly assumes the data is sampled from some (unknown) Gaussian distribution.\n",
    "\n",
    "First we import the `Gobnilp` class and create a `Gobnilp` object as usual."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Academic license - for non-commercial use only\n"
     ]
    }
   ],
   "source": [
    "from gobnilp import Gobnilp\n",
    "m = Gobnilp()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The method `use_continuous_data` does everything we need: reads in data, computes local scores, creates a MIP model and the solves it. Here we use the data file `gaussian.dat`. This data is called 'gaussian.test' in [bnlearn](http://bnlearn.com)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "**********\n",
      "BN has score -54052.41081344564\n",
      "**********\n",
      "A<- -7124.782936593152\n",
      "B<- -12656.351445396509\n",
      "C<-A,B -3743.043565645632\n",
      "D<-B -1548.939409177594\n",
      "E<-C,F,G -7312.558564066843\n",
      "G<- -10530.165518128275\n",
      "F<-A,D,G -11136.569374437633\n",
      "**********\n",
      "[A][B][C|B:A][D|B][E|G:C:F][G][F|D:G:A]\n",
      "CPDAG:\n",
      "Vertices: ['A', 'B', 'C', 'D', 'E', 'G', 'F']\n",
      "A->C\n",
      "A->F\n",
      "B->C\n",
      "B-D\n",
      "C->E\n",
      "D->F\n",
      "G->E\n",
      "G->F\n",
      "F->E\n",
      "\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAV0AAADnCAYAAAC9roUQAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2Z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4ICJbINJl/QYPVreiFwMtxeIiByISZdMp2fPnvDx8bnxtnTpUt0hEd01bi+Q6YSHh3NPl0yLK10iIgdi0iUiciAmXTKd7t2731Kn26tXL90hEd017umSqSS6wnRicmpc6RIRORCTLhGRAzHpEhE5EJMuEZEDMekSETkQky4RkQMx6RIRORCTLhGRAzHpEhE5EJMuEZEDMekSETkQky4RkQMx6RIRORCTLhGRA1mUUkW/02L5HUCS48IhInIKfkqpKoW9445Jl4iIbIvbC0REDsSkS0TkQEy6REQOxKRLRORATLpERA70/3wZSLcQGcnCAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "m.use_continuous_data('gaussian.dat')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "bnlearn's hillclimbing algorithm actually finds a higher-scoring network from the same data. The problem is that we have been using the default parent set size limit of 3. This default value is to make learning practical on datasets with many variables. But here we only have 7 variables so truly optimal learning is easy and we can run with no limit on parent set size."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "**********\n",
      "BN has score -53258.94161814058\n",
      "**********\n",
      "A<- -7124.782936593152\n",
      "B<- -12656.351445396509\n",
      "C<-A,B -3743.043565645632\n",
      "D<-B -1548.939409177594\n",
      "E<- -10545.851006239516\n",
      "F<-A,D,E,G -7109.807736959905\n",
      "G<- -10530.165518128275\n",
      "**********\n",
      "[A][B][C|B:A][D|B][E][F|D:G:A:E][G]\n",
      "CPDAG:\n",
      "Vertices: ['A', 'B', 'C', 'D', 'E', 'F', 'G']\n",
      "A->C\n",
      "A->F\n",
      "B->C\n",
      "B-D\n",
      "D->F\n",
      "E->F\n",
      "G->F\n",
      "\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAV0AAADnCAYAAAC9roUQAAAABH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yXrCQoCevSQD09kZEjt7fXrsiacnS3ru3fdJSViISHqxku2wqRL9E8ZGUCVKjI8vU4dWb6IiFBnMDrZHpMu2UpkZCTOnTsHv5vKyY4dO4Zy5crlPCk42PvRkER54I00sp01a9YgLS3t749bEi6RjzHpEhFpiEmXiEhDTLpkO3FxcQgNDUVoaCji4uL0DodshjfSyHYSExPRlPuVkU54pUtEpCEmXSIiDTHpEhFpiGu6ZCun/rmJJZHGeKVLRKQhJl0iIg0x6RIRaYhJl4hIQ0y6REQaYtIlItIQky4RkYaYdImINMSkS0SkISZdIiINMekSEWmISZeISENMukREGmLSJSLSkENRlLwfdDj+AHBau3CIiCyhoqIopXN7IN+kS0RE6uLyAhGRhph0iYg0xKRLRKQhJl0iIg0x6RIRaej/AFFvlwq6B22SAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "m = Gobnilp()\n",
    "m.use_continuous_data('gaussian.dat',palim=None)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "OK, that's a better network. In fact bnlearn also learns a network with this score when using hill-climbing."
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
